
#include "gd32f4xx.h"
#include "systick.h"
#include <stdio.h>
#include "main.h"
#include "bsp_timer5.h"
#include "bsp_usart0.h"
#include "Task_manager.h"
#include "App.h"

//USART1
int main(void){
	//优先级分组
	nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2);
	//系统滴答时钟初始化
	systick_config();
	//USART0初始化
	bsp_usart0_init(115200);
	printf("app_start\n");
	//初始化任务计数定时器
	bsp_timer5_init();
	//iic0初始化
	bsp_iic0_init();
	//初始化定时器
	bsp_timer8_init();

	//任务初始化
	App_balance_init();
	App_input_init();
	App_protocol_init();
	App_oled_init();
	
	while(1) {
		//判断任务是否要执行
		Task_handler();
	}
}
